import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login/index.vue'),
    meta: {
      title: '小米-登录'
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/Register/index.vue'),
    meta: {
      title: '小米-注册'
    }
  },
  {
    path: '/rest',
    name: 'Rest',
    component: () => import('@/views/Rest/index.vue'),
    meta: {
      title: '小米-重置密码'
    }
  },
  {
    path: '/nextRest',
    name: 'NextRest',
    component: () => import('@/views/NextRest/index.vue'),
    meta: {
      title: '小米-重置密码'
    }
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/Home/index.vue'),
    meta: {
      title: '小米-首页'
    }
  },
  {
    path: '/home/content',
    name: 'Content',
    component: () => import('@/views/Content/index.vue'),
    meta: {
      title: '小米-秒杀'
    }
  }
]

const router = new VueRouter({
  routes
})

export default router
